﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;

namespace WorkflowFramework
{
    public interface IWorkFlowBuilder
    {
        IWorkFlowBuilder AddStep(IFlowStep step);
        IWorkFlowBuilder AddStep<TStep>() where TStep : IFlowStep, new();
        IWorkFlowBuilder AddStep(Func<IFlowStep> stepFactory);
        IWorkFlowBuilder AddStepIf(IFlowStep step, Func<bool> condition);
        IWorkFlowBuilder AddSteps(IEnumerable<IFlowStep> steps);
        IWorkFlowBuilder AddStep(string stepName, Func<Task<FlowStepResult>> executeAction);

        IWorkFlowBuilder Branch(Func<bool> condition, Action<IWorkFlowBuilder> trueBranch, Action<IWorkFlowBuilder> falseBranch = null);

        IWorkFlowExecutor Build();
    }
}
